<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件绑定</title>
	</head>
	<body>
		<div id="app">
			<!-- 事件绑定的语法:
				v-on:click="简单的计算"
				v-on:click="点击事件"
			 -->
			
			展现数据: {{num}}
			<button v-on:click="num++">自增</button>
			<!-- <button v-on:click="addNum">自增函数</button> -->
			<button @click="addNum">自增函数</button>
			
		</div>
		
		<script src="../js/vue.js"></script>
		<script>
			const app = new Vue({
				el: "#app",
				data: {
					num: 100
				},
				methods: {
					addNum(){
						this.num ++
					}
					/* addNum: function(){
						this.num ++
					} */
				}
			})
		</script>
	</body>
</html>
